using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Extraction
{
    /// <summary>
    /// <para>Extract by Rectangle</para>
    /// <para>Extracts the cells of a raster based on a rectangle by specifying the rectangle's extent.</para>
    /// <para>通过指定矩形的范围来提取基于矩形的栅格的像元。</para>
    /// </summary>    
    [DisplayName("Extract by Rectangle")]
    public class ExtractByRectangle : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ExtractByRectangle()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para>The input raster from which cells will be extracted.</para>
        /// <para>将从中提取像元的输入栅格。</para>
        /// </param>
        /// <param name="_rectangle">
        /// <para>Extent</para>
        /// <para><xdoc>
        ///   <para>A rectangle that defines the area to be extracted.</para>
        ///   <para>If the Extent parameter is set to As Specified Below, use the parameters identified with the left and down arrows define the lower-left coordinate of the area to be extracted, and those with the right and up arrows to define the upper-right coordinate.</para>
        ///   <para>If the Extent parameter is set to Browse, you can select a dataset whose bounding box will define the extent.</para>
        ///   <para>The coordinates are specified in the same map units as the input raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义要提取的区域的矩形。</para>
        ///   <para>如果范围参数设置为如下所示，则使用以向左和向下箭头标识的参数定义要提取的区域的左下坐标，并使用向右和向上箭头标识的参数定义右上坐标。</para>
        ///   <para>如果范围参数设置为浏览，则可以选择其边界框将定义范围的数据集。</para>
        ///   <para>坐标的指定方式与输入栅格的地图单位相同。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para>The output raster containing the cell values extracted from the input raster.</para>
        /// <para>包含从输入栅格中提取的像元值的输出栅格。</para>
        /// </param>
        public ExtractByRectangle(object _in_raster, object _rectangle, object _out_raster)
        {
            this._in_raster = _in_raster;
            this._rectangle = _rectangle;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Extract by Rectangle";

        public override string CallName => "sa.ExtractByRectangle";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _rectangle, _out_raster, _extraction_area.GetGPValue()];

        /// <summary>
        /// <para>Input raster</para>
        /// <para>The input raster from which cells will be extracted.</para>
        /// <para>将从中提取像元的输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Extent</para>
        /// <para><xdoc>
        ///   <para>A rectangle that defines the area to be extracted.</para>
        ///   <para>If the Extent parameter is set to As Specified Below, use the parameters identified with the left and down arrows define the lower-left coordinate of the area to be extracted, and those with the right and up arrows to define the upper-right coordinate.</para>
        ///   <para>If the Extent parameter is set to Browse, you can select a dataset whose bounding box will define the extent.</para>
        ///   <para>The coordinates are specified in the same map units as the input raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义要提取的区域的矩形。</para>
        ///   <para>如果范围参数设置为如下所示，则使用以向左和向下箭头标识的参数定义要提取的区域的左下坐标，并使用向右和向上箭头标识的参数定义右上坐标。</para>
        ///   <para>如果范围参数设置为浏览，则可以选择其边界框将定义范围的数据集。</para>
        ///   <para>坐标的指定方式与输入栅格的地图单位相同。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extent")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _rectangle { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output raster containing the cell values extracted from the input raster.</para>
        /// <para>包含从输入栅格中提取的像元值的输出栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Extraction area</para>
        /// <para><xdoc>
        ///   <para>Identifies whether to extract cells inside or outside the input rectangle.</para>
        ///   <bulletList>
        ///     <bullet_item>Inside— A keyword specifying that the cells inside the input rectangle should be selected and written to the output raster. All cells outside the rectangle will receive NoData values on the output raster.</bullet_item><para/>
        ///     <bullet_item>Outside—A keyword specifying that the cells outside the input rectangle should be selected and written to the output raster. All cells inside the rectangle will receive NoData values on the output raster.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>标识是提取输入矩形内部还是外部的单元格。</para>
        ///   <bulletList>
        ///     <bullet_item>Inside- 指定应选择输入矩形内的像元并将其写入输出栅格的关键字。矩形外的所有像元都将在输出栅格上接收 NoData 值。</bullet_item><para/>
        ///     <bullet_item>外部 - 指定应选择输入矩形外部的像元并将其写入输出栅格的关键字。矩形内的所有像元都将在输出栅格上接收 NoData 值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extraction area")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _extraction_area_value _extraction_area { get; set; } = _extraction_area_value._INSIDE;

        public enum _extraction_area_value
        {
            /// <summary>
            /// <para>Inside</para>
            /// <para>Inside— A keyword specifying that the cells inside the input rectangle should be selected and written to the output raster. All cells outside the rectangle will receive NoData values on the output raster.</para>
            /// <para>Inside- 指定应选择输入矩形内的像元并将其写入输出栅格的关键字。矩形外的所有像元都将在输出栅格上接收 NoData 值。</para>
            /// </summary>
            [Description("Inside")]
            [GPEnumValue("INSIDE")]
            _INSIDE,

            /// <summary>
            /// <para>Outside</para>
            /// <para>Outside—A keyword specifying that the cells outside the input rectangle should be selected and written to the output raster. All cells inside the rectangle will receive NoData values on the output raster.</para>
            /// <para>外部 - 指定应选择输入矩形外部的像元并将其写入输出栅格的关键字。矩形内的所有像元都将在输出栅格上接收 NoData 值。</para>
            /// </summary>
            [Description("Outside")]
            [GPEnumValue("OUTSIDE")]
            _OUTSIDE,

        }

        public ExtractByRectangle SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}